import React, {Component} from 'react';
import {View} from 'react-native';
import Expo from 'expo'; 

export default class ExpoLoadFix extends Component {
    
    constructor(...args) {  
        super(...args);  
        this.state = {
            isReady: false  
        };  
    }
    
    render() {
    	if (!this.state.isReady) {
        	return <Expo.AppLoading />;  
       	} else {
       		return this.props.children;
       	}
    }
    
    async componentWillMount() {  
        await Expo.Font.loadAsync({  
            'Roboto': require('native-base/Fonts/Roboto.ttf'),  
            'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf'),  
        });  
        this.setState({isReady: true});
    }
    
}